class Person4 {
  constructor(
    public name: string,
    public age: number,
    private idCard: string
  ) { }
  private getPrivateInfo() {
    console.log(`身份证号码为${this.idCard}`)
  }
  getInfo() {
    console.log(`我叫${this.name}，今年刚满${this.age}岁`)
  }
  getFullInfo() {
    /**
     * 内部可以访问 - private
     */
    console.log(this.getInfo() + "," + this.getPrivateInfo())
  }
}

const p4 = new Person4('jack',11,'123546541245642335465')
p4.getFullInfo()
p4.getInfo()
/**
 * 外部无法访问 - private
 */
// p4.getPrivateInfo() //erroe
